import request from '@/utils/request'

export function getLatestDeployVersion(flowId) {
  return request.get('/v1/flow/version/latest/' + flowId);
}

export function updateFlowVersionStatus(flowVersionId, flowVersionStatus) {
  return request.put('/v1/flow/version/status', { flowVersionId, flowVersionStatus });
}

/**
 * @description
 * @author Golduck
 * @date 06/05/2025
 * @export
 * @param {{ pageNum: number; pageSize: number; flowId: number; flowVersionStatus?: number }} params
 * @return {*}  {ResponsePageResult}
 */
export async function flowVersionPage(params) {
  return request.post('/v1/flow/version/page', params);
}

export async function deleteFlowVersion(id) {
  return request.delete(`/v1/flow/version/delete/${id}`);
}

export async function getAsyncFlowResult(flowInstanceId) {
  return request.get(`/v1/flow/version/getAsyncFlowResult/${flowInstanceId}`);
}
